function showTab(id, loc) {

    var box = document.getElementById(id + "box");
    var tab = document.getElementById(id + "tab");

    if( loc == "topright" )
        topRightBoxHideAll();
    else if( loc == "bottomright" )
        bottomRightBoxHideAll();
    else if( loc == "singlebottomleft" )
        singleBottomLeftBoxHideAll();
        
    
    box.style.display = "block";
    tab.className = "selected";
}


function topRightBoxHideAll() {

    var categorybox = document.getElementById("categorybox");
    var pagesbox = document.getElementById("pagesbox");
    var archivesbox = document.getElementById("archivesbox");
    var aboutbox = document.getElementById("aboutbox");
    
    var categorytab = document.getElementById("categorytab");
    var pagestab = document.getElementById("pagestab");
    var archivestab = document.getElementById("archivestab");
    var abouttab = document.getElementById("abouttab");

    categorybox.style.display = "none";
    pagesbox.style.display = "none";
    archivesbox.style.display = "none";
    aboutbox.style.display = "none";
    
    categorytab.className = "";
    pagestab.className = "";
    archivestab.className = "";
    abouttab.className = "";
}

function bottomRightBoxHideAll() {

    var flickrbox = document.getElementById("flickrbox");
    var linksbox = document.getElementById("linksbox");
    var metabox = document.getElementById("metabox");
    
    var flickrtab = document.getElementById("flickrtab");
    var linkstab = document.getElementById("linkstab");
    var metatab = document.getElementById("metatab");

    flickrbox.style.display = "none";
    linksbox.style.display = "none";
    metabox.style.display = "none";
    
    flickrtab.className = "";
    linkstab.className = "";
    metatab.className = "";
}

function singleBottomLeftBoxHideAll() {

    var commentbox = document.getElementById("commentbox");
    var replybox = document.getElementById("replybox");
    
    var commenttab = document.getElementById("commenttab");
    var replytab = document.getElementById("replytab");

    commentbox.style.display = "none";
    replybox.style.display = "none";
    
    commenttab.className = "";
    replytab.className = "";
}